<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>OnlineTV</title>
        <link href="resources/css/index.css" rel="stylesheet" type="text/css" />
        <!--<link rel="icon" href="/icon.png" type="image/x-icon"> -->
        <!--<link rel="shortcut icon" href="./icon.png" type="image/x-icon"> -->
    </head>
    <h:body>
        <ui:include src="header.xhtml">
            <ui:param name="" value=""/>
        </ui:include>   
        <div class="wrapper">
            <table border="0">
                <tr>
                    <th scope="col" class="menu"> 
                        <ui:include src="menu.xhtml">
                            <ui:param name="" value=""/>
                        </ui:include>
                    </th>
                    <th scope="col" class="postsbk"> 
                        <h:outputText value="User count : #{user.getAllUsers().size()}" style="color: white"/>
                        <table>
                            <th style="color: aqua">ID</th>
                            <th style="color: aqua">Login</th>
                            <th style="color: aqua">Email</th>
                            <th style="color: aqua">FirstName</th>
                            <th style="color: aqua">LastName</th>
                            <c:forEach var="User" items="#{user.getAllUsers()}">
                                <tr>
                                    <td>
                                        <h:outputText value="#{User.getId()}" style="color: white"/>
                                    </td>                                    
                                    <td>
                                        <h:outputText value="#{User.getLogin()}" style="color: white"/>
                                    </td>
                                    <td>
                                        <h:outputText value="#{User.getEmail()}" style="color: white"/>
                                    </td>
                                    <td>
                                        <h:outputText value="#{User.getFirstName()}" style="color: white"/>
                                    </td>
                                    <td>
                                        <h:outputText value="#{User.getLastName()}" style="color: white"/>
                                    </td>
                                    <td>
                                        <h:form>
                                            <h:commandButton value="Delete" action="#{user.deleteUser()}">
                                                <f:param name="id" value="#{User.getId()}"/>
                                            </h:commandButton>
                                        </h:form>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                    </th>
                </tr>
            </table>
        </div>
        <ui:include src="footer.xhtml">
            <ui:param name="" value=""/>
        </ui:include>     
    </h:body>
</html>
